package com.test.generics;

public class GenericObject {
	interface GenericFactory<T> {
		T create();
	}

	class Foo<T> {
		private T x;

		public <F extends GenericFactory<T>> Foo(F factory) {
			x = factory.create();
		}
	}
	
	class IntegerFactory implements GenericFactory<Integer>{
		
		public Integer create(){
			return new Integer(0);
		}
	}
	
	class Widget {
		public  class Factory implements GenericFactory<Widget>{
			public Widget create(){
				return new Widget();
			}
		}
	}

	
	
}
